package com.hckj.jianzhijia.controllers;

import android.content.Context;

import com.hckj.jianzhijia.utils.DataCheckUtil;
import com.hckj.jianzhijia.utils.ToastUtils;

/**
 * Created by 赵奇隆 on 2015-10-19.
 */
public class RegisterInfoController {

    private Context context;

    public RegisterInfoController(Context context) {
        this.context = context;
    }

    //todo 缺少省市区的验证
    public boolean checkAllData(String companyName,String companyEmail,String companyDetailAddress){
        if(!DataCheckUtil.checkString(companyName)){
            ToastUtils.showToast(context, "请输入企业名称");
            return false;
        }

        if(!DataCheckUtil.checkString(companyEmail)){
            ToastUtils.showToast(context,"请输入企业邮箱");
            return false;
        }

        if(!DataCheckUtil.checkString(companyDetailAddress)){
            ToastUtils.showToast(context,"请输入企业详细地址");
            return false;
        }

        if(!DataCheckUtil.isEmail(companyEmail)){
            ToastUtils.showToast(context,"邮箱格式错误");
            return false;
        }

        return true;
    }

}
